package com.chb.controller;

import com.chb.annotation.LogAnnotation;
import com.chb.model.entity.BackLightColor;
import com.chb.model.entity.KeyBoardColor;
import com.chb.model.entity.ShaftChoose;
import com.chb.model.entity.Staff;
import com.chb.model.vo.Result;
import com.chb.service.GoodsService;
import com.chb.service.StaffService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author ：njh
 * @date ：Created in 2023/9/26 15:50
 * @description：键盘类型模块controller
 * @modified By：
 * @version:
 */
@Controller
@RequestMapping("/goodsType")
public class GoodsTypeController {

    @Autowired
    private GoodsService goodsService;

    /**
     * @param currentPage
     * @param pageSize
     * @return Result
     * @create by: njh
     * @description: 查找所有键盘颜色
     * @create time: 2023/9/26 16:03
     */
    @GetMapping("/keyBoardColor")
    @ResponseBody
    public Result keyBoardColor(Integer currentPage, Integer pageSize) {

        Result result = goodsService.findAllKeyBoardColor(currentPage, pageSize);

        return result;
    }

    /**
     * @param keyBoardColor
     * @return
     * @create by: njh
     * @description: 添加键盘颜色
     * @create time: 2023/9/26 17:02
     */
    @RequestMapping("addKeyBoardColor")
    @ResponseBody
    @LogAnnotation(business_type = "添加键盘颜色")
    public void addKeyBoardColor(@RequestBody KeyBoardColor keyBoardColor) {

        goodsService.addKeyBoardColor(keyBoardColor);

    }

    /**
     * @param keyboardcolorid 键盘类型id
     * @return
     * @create by: njh
     * @description: 删除键盘颜色
     * @create time: 2023/9/26 17:02
     */
    @RequestMapping("delKeyBoardColor")
    @ResponseBody
    @LogAnnotation(business_type = "删除键盘颜色")
    public void delKeyBoardColor(Integer keyboardcolorid) {

        goodsService.delKeyBoardColor(keyboardcolorid);

    }

    /**
     * @param keyBoardColor
     * @return
     * @create by: njh
     * @description: 编辑键盘颜色
     * @create time: 2023/9/26 17:51
     */
    @RequestMapping("updKeyBoardColor")
    @ResponseBody
    @LogAnnotation(business_type = "修改键盘颜色")
    public void updKeyBoardColor(@RequestBody KeyBoardColor keyBoardColor) {

        goodsService.updKeyBoardColor(keyBoardColor);

    }

    /**
     * @param currentPage
     * @param pageSize
     * @param keyboardcolorid   键盘颜色id
     * @param keyboardcolorname 键盘颜色名
     * @return Result
     * @create by: njh
     * @description: 根据id或颜色查询符合要求的键盘颜色信息
     * @create time: 2023/9/27 9:41
     */
    @RequestMapping("searchKeyBoardColor")
    @ResponseBody
    public Result searchKeyBoardColor(Integer currentPage, Integer pageSize, Integer keyboardcolorid, String keyboardcolorname) {

        Result result = goodsService.searchKeyBoardColor(currentPage, pageSize, keyboardcolorid, keyboardcolorname);

        return result;
    }


    /**
     * @param currentPage
     * @param pageSize
     * @return Result
     * @create by: njh
     * @description: 查找所有轴体类型
     * @create time: 2023/9/26 16:03
     */
    @GetMapping("/shaftChoose")
    @ResponseBody
    public Result shaftChoose(Integer currentPage, Integer pageSize) {

        Result result = goodsService.findAllShaftChoose(currentPage, pageSize);

        return result;
    }

    /**
     * @param shaftChoose
     * @return
     * @create by: njh
     * @description: 添加轴体类型
     * @create time: 2023/9/26 17:02
     */
    @RequestMapping("addShaftChoose")
    @ResponseBody
    @LogAnnotation(business_type = "添加轴体类型")
    public void addShaftChoose(@RequestBody ShaftChoose shaftChoose) {

        goodsService.addShaftChoose(shaftChoose);

    }

    /**
     * @param shaftchooseid 轴体类型id
     * @return
     * @create by: njh
     * @description: 删除轴体类型
     * @create time: 2023/9/26 17:02
     */
    @RequestMapping("delShaftChoose")
    @ResponseBody
    @LogAnnotation(business_type = "删除轴体类型")
    public void delShaftChoose(Integer shaftchooseid) {

        goodsService.delShaftChoose(shaftchooseid);

    }

    /**
     * @param shaftChoose
     * @return
     * @create by: njh
     * @description: 编辑轴体类型
     * @create time: 2023/9/26 17:51
     */
    @RequestMapping("updShaftChoose")
    @ResponseBody
    @LogAnnotation(business_type = "修改轴体类型")
    public void updShaftChoose(@RequestBody ShaftChoose shaftChoose) {

        goodsService.updShaftChoose(shaftChoose);

    }

    /**
     * @param currentPage
     * @param pageSize
     * @param shaftchooseid 轴体id
     * @param shaftchoose   轴体名
     * @return Result
     * @create by: njh
     * @description: 根据id或轴体类型查询符合要求的轴体类型信息
     * @create time: 2023/9/27 9:41
     */
    @RequestMapping("searchShaftChoose")
    @ResponseBody
    public Result searchShaftChoose(Integer currentPage, Integer pageSize, Integer shaftchooseid, String shaftchoose) {

        Result result = goodsService.searchShaftChoose(currentPage, pageSize, shaftchooseid, shaftchoose);

        return result;
    }


    /**
     * @param currentPage
     * @param pageSize
     * @return Result
     * @create by: njh
     * @description: 查找所有键盘背光类型
     * @create time: 2023/9/26 16:03
     */
    @GetMapping("/backLightColor")
    @ResponseBody
    public Result backLightColor(Integer currentPage, Integer pageSize) {

        Result result = goodsService.findAllBackLightColor(currentPage, pageSize);

        return result;
    }

    /**
     * @param backLightColor
     * @return
     * @create by: njh
     * @description: 添加键盘背光类型
     * @create time: 2023/9/26 17:02
     */
    @RequestMapping("addBackLightColor")
    @ResponseBody
    @LogAnnotation(business_type = "添加背光颜色")
    public void addBackLightColor(@RequestBody BackLightColor backLightColor) {

        goodsService.addBackLightColor(backLightColor);

    }

    /**
     * @param backlightcolorid 键盘颜色id
     * @return
     * @create by: njh
     * @description: 删除键盘背光类型
     * @create time: 2023/9/26 17:02
     */
    @RequestMapping("delBackLightColor")
    @ResponseBody
    @LogAnnotation(business_type = "删除背光颜色")
    public void delBackLightColor(Integer backlightcolorid) {

        goodsService.delBackLightColor(backlightcolorid);

    }

    /**
     * @param backLightColor
     * @return
     * @create by: njh
     * @description: 编辑键盘背光类型
     * @create time: 2023/9/26 17:51
     */
    @RequestMapping("updBackLightColor")
    @ResponseBody
    @LogAnnotation(business_type = "修改背光颜色")
    public void updBackLightColor(@RequestBody BackLightColor backLightColor) {

        goodsService.updBackLightColor(backLightColor);

    }

    /**
     * @param currentPage
     * @param pageSize
     * @param backlightcolorid   键盘颜色id
     * @param backlightcolorname 键盘颜色名
     * @return Result
     * @create by: njh
     * @description: 根据id或键盘背光查询符合要求的键盘背光类型信息
     * @create time: 2023/9/27 9:41
     */
    @RequestMapping("searchBackLightColor")
    @ResponseBody
    public Result searchBackLightColor(Integer currentPage, Integer pageSize, Integer backlightcolorid, String backlightcolorname) {

        Result result = goodsService.searchBackLightColor(currentPage, pageSize, backlightcolorid, backlightcolorname);

        return result;
    }
}